package model;

import java.sql.Connection;
import java.sql.DriverManager;

public class ConnectDatabase {

	public ConnectDatabase() {
	}

	public Connection getConnection() {
		Connection connection = null;

		try {
			Class.forName("com.mysql.jdbc.Driver");
			connection = DriverManager
					.getConnection("jdbc:mysql://localhost:3306/register", "root", "");

		} catch (Exception e) {
			e.printStackTrace();
			System.out.println("error in connect " + e.toString());
		}

		return connection;
	}
	
	public static void main(String[] args) {
		System.out.println(new ConnectDatabase().getConnection());
	}

}
